const events = require('events')
const myEmitter = new events.EventEmitter()

const globalThis = this

myEmitter.on('myEvent', function (a, b, c, d, e) {
    console.log(a, b, c, d, e)
    console.log('----普通函数----')
    console.log(this)
    console.log(myEmitter === this)
    console.log(globalThis === this)
})
myEmitter.on('myEvent', (a, b, c, d, e) => {
    console.log(a, b, c, d, e)
    console.log('----箭头函数----')
    console.log(this)
    console.log(myEmitter === this)
    console.log(globalThis === this)
})
myEmitter.emit('myEvent', 1, 2, 3, 4)
console.log(myEmitter.emit.toString())